package com.iplatform.iplatformzuul;


import com.iplatform.commons.NacosRegRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;

@EnableFeignClients
@EnableZuulProxy
@EnableDiscoveryClient
@SpringBootApplication
public class IplatformZuulApplication extends SpringBootServletInitializer {

    public static void main(String[] args) {
        SpringApplication.run(IplatformZuulApplication.class, args);
    }

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(IplatformZuulApplication.class);
    }

    @Bean
    public NacosRegRunner nacosRegRunner(){
        return new NacosRegRunner();
    }
}
